<?php


namespace app\admin\validate;


use think\Validate;

class advertisingValidate extends Validate
{
    protected $rule = [
        'id'=>'require',
        'name'=> 'require|unique:advertising',
        'link_url'=>'require',
        'image_url'=>'require'

    ];
    protected $message = [
        'id'=>'传入的ID为空',
        'name' => '广告名字必须填写',
        'name.unique' => "广告名字不能重复",
        'link_url'=>'广告链接不能为空',
        'image_url'=>'图片地址不能为空'
    ];

    protected $scene = [
        'advertising_add'=>['name','link_url','image_url'],
        'advertising_edit'=>['name','link_url','id','image_url'],
    ];
}